package com.future.controller;

import com.future.dto.ElectricDto;
import com.future.dto.WaterDto;
import com.future.service.WaterService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("Water")
public class WaterController {
    @Autowired
   private WaterService waterService;


    @RequestMapping("select")
    public PageInfo<WaterDto> select(WaterDto waterDto){
        PageHelper.startPage(waterDto.getCurrent(),waterDto.getSize());
        List list    =   this.waterService.selectWater();
        PageInfo pageInfo=new PageInfo(list);
        return pageInfo;
    }

}
